

function locAddRelatedTo( iTypeToAdd )
{
locAddRelatedToPlusAdditional( iTypeToAdd, "" );
}






function locAddRelatedToPlusAdditional( iTypeToAdd, additionalAttributes )
{
locAddRelatedToNonForm( iTypeToAdd, crmFormSubmit.crmFormSubmitObjectType.value, crmFormSubmit.crmFormSubmitId.value, additionalAttributes );
}



function locAddRelatedToNonForm( iTypeToAdd, createFromType, createFromId, additionalAttributes )
{
var sUrl = "?_CreateFromType=" + CrmEncodeDecode.CrmUrlEncode(createFromType) + "&_CreateFromId=" + CrmEncodeDecode.CrmUrlEncode(createFromId) + additionalAttributes;
openFrmObj( sUrl, buildWinName(), iTypeToAdd );
}


function locAddObjTo(iType)
{
openObjEx(iType, crmFormSubmit.crmFormSubmitObjectType.value, crmFormSubmit.crmFormSubmitId.value);
}


function locAddFileTo(iAttachmentType)
{
var sUrl = "/" + getObjUrl(iAttachmentType) + "?hideDesc=1&pId=" + CrmEncodeDecode.CrmUrlEncode(crmFormSubmit.crmFormSubmitId.value) + "&pType=" + CrmEncodeDecode.CrmUrlEncode(crmFormSubmit.crmFormSubmitObjectType.value);
openStdWin(prependOrgName(sUrl), buildWinName(), 500, 175);
}



function locAddAttachmentForWorkflow(workflowid,stepid)
{
var sUrl = "/" + getObjUrl(Annotation) + "?hideDesc=1&pId=" + CrmEncodeDecode.CrmUrlEncode(workflowid) + "&pType=" + CrmEncodeDecode.CrmUrlEncode(Workflow) + "&stepId=" + CrmEncodeDecode.CrmUrlEncode(stepid);
openStdWin(prependOrgName(sUrl), buildWinName(), 500, 175);
}

